package com.funong.matrix.biz.base.dao;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.funong.matrix.biz.base.entity.SysFileInfoEntity;
import com.funong.matrix.biz.base.mapper.SysFileInfoMapper;
import com.funong.matrix.core.base.Dao;
import com.funong.matrix.core.base.FunongBaseDao;
import com.funong.matrix.core.enums.IsDeletedEnum;
import org.aspectj.lang.annotation.Aspect;

import java.util.List;

/**
 * @author : NaNa
 * @since : 2023-05-26 18:21
 **/

@Aspect
@Dao
public class SysFileInfoDao extends FunongBaseDao<SysFileInfoMapper, SysFileInfoEntity> {
    /**
     * 根据ID获取文件信息
     *
     * @param fileIdList 文件ID集合
     * @return 文件基础信息
     */
    public List<SysFileInfoEntity> getFileListByIds(List<Integer> fileIdList) {
        return this.list(Wrappers.<SysFileInfoEntity>lambdaQuery()
                .in(SysFileInfoEntity::getId, fileIdList)
                .eq(SysFileInfoEntity::getIsDeleted, IsDeletedEnum.NOT_DELETED.getValue())
        );
    }
}
